<?php
defined("BASE_PATH") or exit('Access Denied');

function getRouter(){
	$controller = empty($_GET['c']) ? 'Index' : $_GET['c'];
	$controller = ucfirst($controller);
	$action = empty($_GET['a']) ? 'index' : $_GET['a'];
	$controllerName = '\Controller\\'.$controller;
	$GLOBALS['controller'] = $controller;	//全局注册控制器名
	$GLOBALS['action'] = $action;			//全局注册方法名
	//pathinfo模式待添加
	$controllerName = '\Controller\\'.$controller;
	$controllerObj = new $controllerName();
	$controllerObj->$action();
}


function run(){
	getRouter();
}
?>